using UnityEngine;
using UnityEngine.EventSystems;

public static class ExecuteEventsExtension
{
    public static bool ExecuteClickHandler(GameObject go,BaseEventData eventData)
    {
        return ExecuteEvents.Execute(go, eventData, ExecuteEvents.pointerClickHandler);
    }
    public static bool ExecuteBeginDragHandler(GameObject go,BaseEventData eventData)
    {
        return ExecuteEvents.Execute(go, eventData, ExecuteEvents.beginDragHandler);
    }
    public static bool ExecuteEndDragHandler(GameObject go,BaseEventData eventData)
    {
        return ExecuteEvents.Execute(go, eventData, ExecuteEvents.endDragHandler);
    }
    public static bool ExecuteDragHandler(GameObject go,BaseEventData eventData)
    {
        return ExecuteEvents.Execute(go, eventData, ExecuteEvents.dragHandler);
    }
    public static bool ExecutePointDownHandler(GameObject go,BaseEventData eventData)
    {
        return ExecuteEvents.Execute(go, eventData, ExecuteEvents.pointerDownHandler);
    }
    public static bool ExecutePointUpHandler(GameObject go,BaseEventData eventData)
    {
        return ExecuteEvents.Execute(go, eventData, ExecuteEvents.pointerUpHandler);
    }
    
    public static GameObject GetClickEventHandler(GameObject root)
    {
        return ExecuteEvents.GetEventHandler<IPointerClickHandler>(root);
    }
    public static GameObject GetBeginDragEventHandler(GameObject root)
    {
        return ExecuteEvents.GetEventHandler<IBeginDragHandler>(root);
    }
    public static GameObject GetDragEventHandler(GameObject root)
    {
        return ExecuteEvents.GetEventHandler<IDragHandler>(root);
    }    
    public static GameObject GetEndDragEventHandler(GameObject root)
    {
        return ExecuteEvents.GetEventHandler<IEndDragHandler>(root);
    }
}